import com.guwu.dao.data.Member;
import com.guwu.dao.data.MemberMapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.transaction.annotation.Transactional;


/**
 * Created by yb on 2017/10/22.*/
/*
@RunWith(SpringJUnit4ClassRunner.class) 使用junit 能攻使用log4j 特殊生成了一个JUnit4ClassRunner 的类，进行log4j2的初始化.slf4j 还不能够使用
 */
@RunWith(JUnit4ClassRunner.class)
@ContextConfiguration(locations = {"/spring-mybatis.xml"})
@Transactional
public class test {

    private static Logger logger = LoggerFactory.getLogger(test.class);
/*
    private static Logger logger = LoggerFactory.getLogger(test.class.getName());
*/

        @Autowired
    public MemberMapper memberMapper;

    @Test
    public void memeber_test() {
        logger.info("查询一条记录");
        Member member= memberMapper.selectByPrimaryKey(121);

       logger.info("查询一条记录");
    }
}

